1. Field of the Invention
The present invention relates to a color-reduction processing technique of a color image.
2. Description of the Related Art
In recent years, along with digitization of information, a system in which a paper document is scanned by, for example, a scanner so as to be converted into digital data, and the digital data is stored or transmitted to another apparatus without being preserved intact has prevailed. Also, colors used in a document itself transit from monochrome binary values to color values (multi-values). When a color image is used intact, a large data size is required. Hence, color-reduction processing is executed by selecting representative colors from the image.
Watanabe “A Fast Algorithm for Color Image Quantization Using Only 256 Colors”, The Transactions of the Institute of Electronics, Information and Communication Engineers 70(4), pp. 720-726, 1987-04 (non-patent literature 1) discloses a method of color-reducing an input image to a 256-color image. An RGB color space is divided into 4×4×4 cube areas, and a color occurrence frequency distribution (histogram) for each of the 4×4×4 cube areas is calculated by referring to upper 2 bits of an input digital color signal (8 bits for each of RGB (red, green, and blue) signals). Next, variance values are calculated for each of the 64 cube areas, and each of 32 cube areas having the large variance is divided into two. Furthermore, an operation for calculating variance values of the divided areas and dividing the areas having large variance into two is repeated until the number of areas reaches 256. Furthermore, the average colors calculated from each of the divided 256 areas are determined as representative colors.
Japanese Patent Laid-Open No. 2004-336211 (patent literature 1) discloses a method to divide a document image into blocks, and to switch an encoding method for each block. Density histograms are calculated for respective blocks, and a block is determined to be a “mono-color block” if a variance of the entire density histogram of the block is small. On the other hand, as for a block having a large variance, a threshold that maximizes a variance ratio is set to separately generate histograms of foreground and background colors. When both of the histograms of the foreground and background colors have small variance values, the block of interest is determined as a “two-color block”; otherwise, it is determined as a “multi-color block”. Furthermore, binary encoding is applied to two-color blocks, and multi-value encoding is applied to multi-color blocks.
However, the color-reduction method described in non-patent literature 1 comes to have much computational complexity because the variance calculation process and the color space division process must be executed repeatedly. Since an RGB color space is used, and variances of respective color components are calculated for each of areas, complicated calculations are required. Also, patent literature 1 generates histograms for respective tiles, and switches an encoding method by determining each tile as mono-color block, two color block or multi-color block based on the variance value of each histogram. The patent literature 1 does not determine representative colors when multi-value encoding (e.g. JPEG encoding) is applied to the multi-color block (i.e. the multi-color block including more than three colors).